#include <iostream>
#include <string>
#include <cstring>
#include <cctype>
using namespace std;

int main()
{
	int sum=0,cnt=0,ret=0;
	string str;
	string tmp;
	while(cin>>tmp)
		str+=' '+tmp;
	int pos=0;
	while(pos<str.size())
	{
		int A=0,a=0,num=0;
		string s;
		while(pos<str.size() && !isalnum(str[pos]))
		{
			pos++;
		}
		while(pos<str.size() && isalnum(str[pos]))
		{
			s+=str[pos];
			pos++;
		}
		if(s.size())
		{
			cnt+=s.size();
			ret++;
		}
		for(auto& t: s)
		{
			if(t>='0' && t<='9')
				num++;
			else if(t>='A' && t<='Z')
				A++;
			else if(t>='a' && t<='z')
				a++;
		}
		if(num>0 && A>0 && a>0)
			sum+=5;
		else if(num>0 && (A>0 || a>0))
			sum+=3;
		else if(A>0 && a>0)
			sum+=1;
	}
	cout<<sum<<endl;
	cout<<cnt<<' '<<ret;
	return 0;
}
